package com.lzj.demo.design.strategy.fzw;

import com.lzj.demo.design.strategy.FileTypeResolveEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum CouponEnum {

    MJ("MJ",new BigDecimal(100)),
    ZJ("ZJ",new BigDecimal(10));

    private String code;
    private BigDecimal price;
    public static CouponEnum getEnumByCode(String code) {
        for (CouponEnum dataEnum : CouponEnum.values()) {
            if (dataEnum.getCode().equals(code)) {
                return dataEnum;
            }
        }
        return null;
    }
}
